const globalPath = require("./src/config/index.js");

/**
 *
 *  配置前端代理，以及开发环境配置
 */
module.exports = {
    publicPath: globalPath.jsonPath,
    pages: {
        index: {
            entry: ["node_modules/core-js", "src/main.ts"],
        },
    },
    configureWebpack: {
        resolve: {
            alias: {
                // 别名
                vue$: "vue/dist/vue.esm.js",
            },
        },
    },
    devServer: {
        port: "8888",
        open: true,
        proxy: {
            "/weatherApi": {
                target: "http://t.weather.sojson.com",
                changeOrigin: true, //是否跨域
                pathRewrite: {
                    "^/weatherApi": "",
                },
            },
        },
    },
};